﻿using BCDto.Common.SystemConfiguration;
using BCDto.TMS.Driver.SystemConfiguration;
using BCService.Common.SystemConfiguration;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Threading.Tasks;

namespace BCTMSRESTful.Controllers.DriverApp.SystemConfiguration
{
    /// <summary>
    /// 司机端系统配置
    /// </summary>
    [Route("api/v1/DriverApp/[controller]")]
    [ApiExplorerSettings(GroupName = "DriverApp")]
    public class SystemConfigurationController : DriverAppBaseController
    {
        private readonly ISystemConfigurationService systemConfigurationService;

        public SystemConfigurationController(ISystemConfigurationService systemConfigurationService)
        {
            this.systemConfigurationService = systemConfigurationService;
        }

        #region 获取系统配置
        /// <summary>
        ///  获取系统配置
        /// </summary>
        /// <response code="200">获取系统配置</response>
        /// <response code="400">请求参数或输入的数据不正确。</response>
        /// <response code="500">服务器发生错误。</response>
        /// <response code="501">某些功能尚未实现。</response>
        /// <returns></returns>
        [HttpGet]
        [ProducesResponseType(typeof(DriverAppSystemConfigurationDto), 200)]
        public IActionResult Get()
        {
            return StatusCode((int)HttpStatusCode.OK, this.systemConfigurationService.GetDriverAppConfig());
        }
        #endregion
    }
}
